home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / CDTools / MUIRexx / demos / MUIRexxDock / dock_set.rexx < prev    next >
OS/2 REXX Batch file  |  1997-05-02  |  2KB  |  69 lines

  1. /* */
  2. options results
  3. parse arg m' 'n' 'obj
  4.  
  5. address dock
  6.  
  7. if obj = '' then do
  8.     getvar B00
  9.     if result ~= '' then parse var result 'ICON "'obj'"'
  10.     else exit
  11. end
  12. cycle ID BTYPE
  13. type = result
  14. entry = type 'ICON "'||obj||'"'
  15. if lastpos('/',obj) ~= 0 then objname = substr(obj,lastpos('/',obj)+1)
  16. else objname = substr(obj,lastpos(':',obj)+1)
  17. select
  18.     when type = 'pop' then do
  19.         call open('pop',objname'.pop','W')
  20.         i = 0
  21.         do forever
  22.             list ID LLST POS i
  23.             line = result
  24.             if line = '' then break
  25.             call writeln('pop',line)
  26.             i = i + 1
  27.         end
  28.         call close('pop')
  29.     end
  30.     otherwise nop
  31. end
  32.  
  33. popasl ID PCOMM
  34. if result ~= '' then do
  35.     entry = entry||' PCOMM "'||result||'"'
  36.     string ID PPORT
  37.     if result ~= '' then entry = entry||' PPORT "'||result||'"'
  38. end
  39.  
  40. popasl ID ACOMM
  41. if result ~= '' then do
  42.     entry = entry||' ACOMM "'||result||'"'
  43.     string ID APORT
  44.     if result ~= '' then entry = entry||' APORT "'||result||'"'
  45. end
  46.  
  47. popasl ID DCOMM
  48. if result ~= '' then do
  49.     entry = entry||' DCOMM "'||result||'"'
  50.     string ID DPORT
  51.     if result ~= '' then entry = entry||' DPORT "'||result||'"'
  52. end
  53.  
  54. list ID ILST POS 0
  55. if result ~= '' then do
  56.     call open('add',objname'.add','W')
  57.     i = 0
  58.     do forever
  59.             list ID ILST POS i
  60.             line = result
  61.             if line = '' then break
  62.             call writeln('add',line)
  63.             i = i + 1
  64.     end
  65.     call close('add')
  66. end
  67.  
  68. setvar B||m||n entry
  69.